﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpGen.Compiler
{
    /// <summary>
    /// Stellt ein Message-Element dar
    /// </summary>
    [Serializable]
    public class OpGenMessage : OpGenClass
    {
        /// <summary>
        /// Erstellt eine neue Instanz der MessageElement-Klasse
        /// </summary>
        /// <param name="Element"></param>
        public OpGenMessage(OpGenNamespace Element) : base(Element)
        {
            Code = 0;
        }

        /// <summary>
        /// Liefert den Element Typen
        /// </summary>
        public new ElementTypeEnum ElementType
        {
            get { return ElementTypeEnum.Message; }
        }

        /// <summary>
        /// Liefert den Message Code
        /// </summary>
        public int Code { get; set; }

        /// <summary>
        ///  Liefert die Textbezeichnung des Elements
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format("{0} {1} {2} \n CODE: {3}", Modifier.ToString(), ElementType.ToString(), Elementname, Code);
        }
    }
}